<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		 <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no">
		<link rel="stylesheet" type="text/css" href="__TMPL__/public/my/css/my.css?{:time()}"/>
		<title>我的</title>
         <php>
            $flag=true;
           if($user['card_end_time']){
             $date=date('Y-m-d 23:59:59',$user['card_end_time']);
             $card_end_time=strtotime($date);
             $time=time();            
             if($time>$card_end_time){
                  $flag=false;
             }
           }else{
           		 $flag=false;
           }
             if($user['card_type']==5){
				 $flag=true;
			 }
           if(!$user['card_type']&&!$flag){ 
      	</php>
      		<style>
                .top { background-color: #23262f; width: 100%; height: 110px; padding-top: 20px;margin-top: -1px;border-bottom-left-radius: 0;border-bottom-right-radius: 0;border-bottom: 20px solid #eee; }
                body {background: #FFFFFF;}
                .meau2 {margin-top: 0px;}
      		</style>
     	 <php>}</php>
	</head>
	<body>
		<header data="{}"> 
		<div class="content"> <a>我的</a></div> 
		</header> 
		<div class="top">
			<div class="txbox"  onclick="location.href='{:url(\'user/profile/edit\')}'">
				<div class="touxiang">
                  <if condition="empty($user['avatar'])">
                        <img src="__TMPL__/public/user/img/tx1.png"/>
                        <else/>
                        <img src="{:cmf_get_user_avatar_url($user['avatar'])}" />
                    </if>
              </div>
			</div>
			<div class="name"  onclick="location.href='{:url(\'user/profile/edit\')}'">
			<p>{$user.user_nickname}</p>
			<p><span>{$user.mobile}</span></p></div>
			<div class="code">
			<p><span>积分{$user.score}</span></p></div>
		</div>
      <php>
      	if($user['card_type']&&$flag){
		 	 if($user['card_type']==5){
				  $src='__TMPL__/public/my/img/experienceicon.png';
				  $name='免费卡';
				  $right_name='普通会员';
			 }
			if($user['card_type']==1){
				$src='__TMPL__/public/my/img/experienceicon.png';
				$name='体验卡';
				$right_name='体验会员';
			}
			if($user['card_type']==2){
				$src='__TMPL__/public/my/img/halfyearicon.png';
				$name='半年卡';
				$right_name='vip会员卡';
			}
			if($user['card_type']==3){
				$src='__TMPL__/public/my/img/yearicon.png';
				$name='年卡';
				$right_name='VIP会员';
			}
			if($user['card_type']==4){
				$src='__TMPL__/public/my/img/famiyearicon.png';
				$name='股东家庭年卡';
				$right_name='VIP会员';
			}

      </php>
		<div class="card" onclick="location.href='{:url(\'user/profile/card_info\')}'">
		<p><img src="__TMPL__/public/my/img/halfyearicon.png"/>
		<span>{$name}</span></p>
		<p style="display:none">{$right_name}</p>
          <php>if($user['card_type']==5){</php>
          <p>有效期: 无限期 </p>
          <p>指定门店：{$store_info.store_name}</p>
          <php>}else{</php>
          <p>有效期:  {:date('Y-m-d',$user['card_end_time'])}   </p>
          <p>购买门店：{$store_info.store_name}</p>
          <php>}</php>
		
		
		</div>
		<php>}</php>
		<div class="meau2">
			<div style="display:none">绑定手机</div>
			<div onclick="location.href='{:url(\'user/order/index\')}'">我的订单</div>
			<div onclick="location.href='{:url(\'user/profile/address\')}'">我的地址</div>
			<div onclick="location.href='{:url(\'portal/page/index\',array(\'id\'=>1))}'">关于我们</div>
			<div onclick="location.href='{:url(\'portal/list/index\',array(\'id\'=>1))}'">使用帮助</div>
			<php>if($role_store){</php>
				<div class="dpgl"  onclick="location.href='{:url(\'user/store/index\')}'">店铺管理</div>
			<php>}</php>
          <php>if($role_user){</php>
			<div class="lmgl"  onclick="location.href='{:url(\'user/group/index\')}'">联盟管理</div>          
          <php>}</php>
		</div>

		<include file="public@footer" />
	</body> 
</html>
